<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form prependId="false">
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{empresaEditMB.insert}"
						rendered="#{!empresaEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.save']}" action="#{empresaEditMB.update}"
						rendered="#{empresaEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.delete']}" onclick="confirmation.show()"
						rendered="#{empresaEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.delete']}" severity="alert" widgetVar="confirmation">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{empresaEditMB.delete}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>

			<br />

			<p:fieldset legend="#{messages['empresa.label']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid id="fields" columns="3">
					<h:outputLabel value="#{messages['empresa.label.id']}: " for="id" styleClass="text-input" />
					<h:outputText id="id" value="#{empresaEditMB.bean.id}" />
					<p:message for="id" />
			
					<h:outputLabel value="#{messages['empresa.label.codigo']}: " for="codigo" styleClass="text-input" />
					<h:inputText id="codigo" value="#{empresaEditMB.bean.codigoEmpresa}" title="#{messages['empresa.label.codigo']}"  />
					<p:message for="codigo" />
			
					<h:outputLabel value="#{messages['empresa.label.cnpj']}: " for="cnpj" styleClass="text-input" />
					<h:inputText id="cnpj" value="#{empresaEditMB.bean.cnpj}"
						title="#{messages['empresa.label.cnpj']}" />
					<p:message for="cnpj" />
					
					

					<h:outputLabel value="#{messages['empresa.label.razao']}: " for="razao" styleClass="text-input" />
					<h:inputText id="razao" value="#{empresaEditMB.bean.razaoSocial}" title="#{messages['empresa.label.razao']}" size="50"/>
					<p:message for="razao" />
					
					
					<h:outputLabel value="#{messages['empresa.label.nome']}: " for="fantasia" styleClass="text-input" />
					<h:inputText id="fantasia" value="#{empresaEditMB.bean.nomeFantasia}" title="#{messages['empresa.label.nome']}" size="50" />
					<p:message for="fantasia" />				
					
					
				</h:panelGrid>
			</p:fieldset>
			<br />
			<p:dataTable id="list" var="bean" editable="true"
				value="#{empresaEditMB.}" paginator="true" rows="5" 
				  
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                 rowsPerPageTemplate="5,10,15,20" >


				<f:facet name="header">#{messages['categoriaocorrencia.list.table.title']}</f:facet>
				<p:column style="width:5%;">
					<h:selectBooleanCheckbox
						value="#{categoriaOcorrenciaListMB.selection[bean.id]}" />
				</p:column>

				<p:column style="width:5%;" sortBy="#{bean.id}">
					<f:facet name="header">#{messages['categoriaocorrencia.label.id']}</f:facet>
					<h:outputText value="#{bean.id}" />
				</p:column>

				<p:column sortBy="#{bean.descricao}">
					<f:facet name="header">#{messages['categoriaocorrencia.label.description']}</f:facet>
					<h:commandLink action="#{categoriaOcorrenciaListMB.getNextView}"
						actionListener="#{categoriaOcorrenciaListMB.clear}">
						<h:outputText value="#{bean.descricao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>				
								
				
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>